﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ScheduleMaker.DB.Domain
{
    public class Teacher : User
    {
        private string name;
        private IList<Subject> subjects;
        private IList<Hour> hours;

        public virtual string Name
        {
            get { return name; }
            set { name = value; }
        }

        public virtual IList<Subject> Subjects
        {
            get { return subjects; }
            set { subjects = value; }
        }

        public virtual IList<Hour> Hours
        {
            get { return hours; }
            set { hours = value; }
        }

        public override bool Equals(object obj)
        {
            if (obj == null)
                return false;
            var t = obj as Teacher;
            if (t == null)
                return false;
            if (Id == t.Id
                && Name == t.Name
                && Login == t.Login
                && Firstname == t.Firstname
                && Surname == t.Surname)
                return true;
            return false;
        }

        public override int GetHashCode()
        {
            return (Id + "|"
                + Name + "|"
                + Login + "|"
                + Firstname + "|"
                + Surname).GetHashCode();
        }

    }


}
